<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>stu的initial页面(测试分支，显示满足条件的内容)</title>
</head>
<body>
<h3>使用th:object获取数据，th:field测试分支语句，单选框二选一(符合条件为选中状态)</h3>
    <div th:object="${stu}">
        <p>
            <label>性别:</label>
            <label>
                <input type="radio" th:field="*{stuSex}" name="stuSex" th:value="男">男
            </label>
            <label>
                <input type="radio" th:field="*{stuSex}" name="stuSex" th:value="女">女
            </label>
        </p>
    </div>
    <hr>
    <h3>使用${xxx}获取数据，th:if测试分支语句</h3>
        <div>
            <span th:if="${stu.stuSexNo}==1">1男</span>
            <span th:if="${stu.stuSexNo}==2">2女</span>
<!--            可以使用==判断字符串字符串可以加''也可以不加-->
            <span th:if="${stu.stuSex}==男">3男</span>
            <span th:if="${stu.stuSex}=='男'">4男</span>
        </div>
    <hr>
    <h3>使用${xxx}获取数据,th:switch测试分支语句</h3>
    <div th:switch="${stu.stuSexNo}">
        <span th:case="1">男</span>
        <span th:case="2">女</span>
    </div>

</body>
</html>